import ast
from twisted.plugin import IPlugin
from dopplershift.core.plugins.interfaces import IDSPlugin
from zope.interface import implements
from dopplershift.core.containers.mediator import getMediator

class DSBackendDatabase(object):
    implements(IDSPlugin, IPlugin)
    application = 'backend.db'
    name = 'default'
    def configure(self, config):
        self._config = config
        mediator = getMediator()
        check = config.get('%s_default'%self.application, 'plugin', self.application)
        if not check is None and check == self.name:
            mediator.register('AppDB', self)
        mediator.register("%sDB"%self.name, self)
        
            